[ana6, com8]: Add ana6Optimisation Module, apply changes in com8MoTPSA#1245
[ana6, com8]: Add ana6Optimisation Module, apply changes in com8MoTPSA#1245RolandFischbacher wants to merge 5 commits intomasterfrom
Conversation
❌ 3 blocking issues (4 total)
@qltysh one-click actions:
|
f66f702 to
38e42ca
Compare
Squash of 20 commits from RF_com8MoTPSA branch including: - com8MoTPSA workflow improvements (chunked multiprocessing, path handling) - Bayesian optimisation integration (ana6Optimisation module) - Morris sensitivity analysis scripts - AIMEC runout reference implementation - probAna pickle saving and bounds - Plotting and config improvements
|
Coverage Impact ⬇️ Merging this pull request will decrease total coverage on Modified Components (1)
Modified Files with Diff Coverage (2)
🤖 Increase coverage with AI coding...🚦 See full report on Qlty Cloud » 🛟 Help
|
- Add bounds to paramValuesD in createSamplesWithVariation (StandardParameters) - Add writing of visualisation scenario and sampling method to com8MoTPSACfg.ini
| @@ -0,0 +1,886 @@ | |||
| import numpy as np | |||
There was a problem hiding this comment.
A general note for this file: use log.info instead of prints for user info
| return xBest, xBestDict, np.max(ei), np.max(lcb) | ||
|
|
||
|
|
||
| def runCom8MoTPSA(avalancheDir, xBestDict, cfgMain, i=0, optimisationType=None): |
There was a problem hiding this comment.
I think this could be solved differently, as it duplicates code that might be changed. Investigate if a direct call with updated cfgs would be better. Let me now if you need help
There was a problem hiding this comment.
Implemented a direct call of com8MoTPSAMain with updated cfgs (writeCfgFiles in optimisationUtils.py)
| if 'VISUALISATION' in config.sections(): | ||
| # config is inifile | ||
| index = config['VISUALISATION']['scenario'] | ||
|
|
||
| if 'VISUALISATION' in config.sections(): | ||
| # config is inifile | ||
| index = config['VISUALISATION']['scenario'] | ||
| if 'sampleMethod' in config['VISUALISATION']: | ||
| sampleMethod = config['VISUALISATION']['sampleMethod'] |
There was a problem hiding this comment.
if any .ini file in the config directory lacks a VISUALISATION section, the variables index and sampleMethod are never assigned, but they are unconditionally appended on lines 107-108. On the first such file, this raises UnboundLocalError. Even if subsequent iterations reuse a stale value from a previous file, the data would be silently wrong.
| # config is inifile | ||
| index = config['VISUALISATION']['scenario'] | ||
|
|
||
| if 'VISUALISATION' in config.sections(): |
There was a problem hiding this comment.
Why the duplicate if? Copy/Paste error?
| if modName.lower() in ["com1dfa", "com5snowslide", "com6rockavalanche", 'com8motpsa']: | ||
| cfgStart["VISUALISATION"]["scenario"] = str(count1) | ||
| cfgStart["INPUT"]["thFromIni"] = paramValuesD["thFromIni"] | ||
| cfgStart["VISUALISATION"]["sampleMethod"] = cfg['PROBRUN']['sampleMethod'] |
There was a problem hiding this comment.
The new line cfgStart["VISUALISATION"]["sampleMethod"] = cfg['PROBRUN']['sampleMethod'] reads sampleMethod from cfg['PROBRUN'].
However, probAnaCfg.ini has sampleMethod under [PROBRUN] only when probAna is the caller. If createCfgFiles is called from a different path where cfg doesn't have PROBRUN.sampleMethod, this will raise KeyError. The code also assumes VISUALISATION section exists in cfgStart for com8MoTPSA — while the new com8MoTPSACfg.ini does add it, there's no sampleMethod default there, making the flow dependent on the caller always providing this key.
| mean_sigma = topNData["sigma"].mean() | ||
| std_sigma = topNData["sigma"].std() | ||
|
|
||
| print(f"\n🔍 Mittelwerte ± Std (Top {N}):") |
There was a problem hiding this comment.
as mentioned elsewhere: log.info AND english text please

This PR introduces a new optimisation module
ana6Optimisationforcom8MoTPSAand updates the simulation workflow.The module ana6Optimisation includes:
New files in ana6Opitmisaton:
runMorrisSA.py(configuration:runMorrisSACfg.ini)runPlotMorrisConvergence.py(usesrunMorrisSACfg.ini)runOptimisation.py(configuration:runOptimisationCfg.ini)optimisationUtils.pyREADME_ana6.md(contains usage instructions)New file in out3Plot:
outAna6Plots.pyChanged workflow of runing com8MoTPSA: